home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / vbdos5 / form1.frm < prev    next >
Text File  |  1995-12-05  |  8KB  |  276 lines

  1. VERSION 2.00
  2. Begin Form Form1 
  3.    AutoRedraw      =   -1  'True
  4.    Caption         =   "MS DOS 5.0 FORMAT"
  5.    ClientHeight    =   2775
  6.    ClientLeft      =   525
  7.    ClientTop       =   2955
  8.    ClientWidth     =   6510
  9.    FontBold        =   -1  'True
  10.    FontItalic      =   0   'False
  11.    FontName        =   "MS Sans Serif"
  12.    FontSize        =   12
  13.    FontStrikethru  =   0   'False
  14.    FontUnderline   =   0   'False
  15.    Height          =   3180
  16.    Icon            =   FORM1.FRX:0000
  17.    Left            =   465
  18.    MousePointer    =   1  'Arrow
  19.    ScaleHeight     =   2775
  20.    ScaleWidth      =   6510
  21.    Top             =   2610
  22.    Width           =   6630
  23.    Begin CommandButton fmtit 
  24.       Caption         =   "OK"
  25.       Enabled         =   0   'False
  26.       Height          =   375
  27.       Left            =   5160
  28.       TabIndex        =   8
  29.       Top             =   2160
  30.       Visible         =   0   'False
  31.       Width           =   855
  32.    End
  33.    Begin TextBox infobox 
  34.       BackColor       =   &H00FF0000&
  35.       Enabled         =   0   'False
  36.       Height          =   375
  37.       Left            =   1320
  38.       TabIndex        =   4
  39.       Top             =   2160
  40.       Width           =   3855
  41.    End
  42.    Begin CommandButton stopit 
  43.       Caption         =   "STOP"
  44.       Enabled         =   0   'False
  45.       Height          =   375
  46.       Left            =   480
  47.       TabIndex        =   9
  48.       Top             =   2160
  49.       Visible         =   0   'False
  50.       Width           =   855
  51.    End
  52.    Begin CheckBox CheckSd 
  53.       Caption         =   "System Disk"
  54.       Height          =   255
  55.       Left            =   480
  56.       TabIndex        =   7
  57.       Top             =   1680
  58.       Width           =   1455
  59.    End
  60.    Begin CheckBox CheckUn 
  61.       Caption         =   "Unconditional"
  62.       Height          =   255
  63.       Left            =   480
  64.       TabIndex        =   5
  65.       Top             =   1440
  66.       Width           =   1575
  67.    End
  68.    Begin CheckBox CheckQk 
  69.       Caption         =   "Quick Format"
  70.       Height          =   255
  71.       Left            =   480
  72.       TabIndex        =   6
  73.       Top             =   1200
  74.       Width           =   1575
  75.    End
  76.    Begin CommandButton Quickfmt 
  77.       Caption         =   "Format"
  78.       Default         =   -1  'True
  79.       FontBold        =   -1  'True
  80.       FontItalic      =   0   'False
  81.       FontName        =   "MS Sans Serif"
  82.       FontSize        =   12
  83.       FontStrikethru  =   0   'False
  84.       FontUnderline   =   0   'False
  85.       Height          =   615
  86.       Left            =   4680
  87.       TabIndex        =   2
  88.       Top             =   960
  89.       Width           =   1335
  90.    End
  91.    Begin OptionButton Option3 
  92.       Caption         =   "3 1/2"
  93.       Height          =   255
  94.       Left            =   1320
  95.       TabIndex        =   12
  96.       Top             =   960
  97.       Visible         =   0   'False
  98.       Width           =   855
  99.    End
  100.    Begin OptionButton Option5 
  101.       Caption         =   "5 1/4"
  102.       Height          =   255
  103.       Left            =   480
  104.       TabIndex        =   11
  105.       Top             =   960
  106.       Value           =   -1  'True
  107.       Visible         =   0   'False
  108.       Width           =   855
  109.    End
  110.    Begin CheckBox CheckHD 
  111.       Caption         =   "High Density"
  112.       Height          =   255
  113.       Left            =   480
  114.       TabIndex        =   3
  115.       Top             =   720
  116.       Value           =   1  'Checked
  117.       Width           =   1455
  118.    End
  119.    Begin DriveListBox drive1 
  120.       Height          =   315
  121.       Left            =   2280
  122.       TabIndex        =   0
  123.       Top             =   240
  124.       Width           =   2415
  125.    End
  126.    Begin Label warn 
  127.       BackColor       =   &H000000FF&
  128.       Caption         =   "WARNING ! You may not be formatting a floppy drive !         To protect a hard drive assign it a volume label."
  129.       Height          =   1215
  130.       Left            =   2280
  131.       TabIndex        =   10
  132.       Top             =   720
  133.       Visible         =   0   'False
  134.       Width           =   1935
  135.    End
  136.    Begin Label Label1 
  137.       Caption         =   "Select Drive"
  138.       FontBold        =   -1  'True
  139.       FontItalic      =   0   'False
  140.       FontName        =   "MS Sans Serif"
  141.       FontSize        =   12
  142.       FontStrikethru  =   0   'False
  143.       FontUnderline   =   0   'False
  144.       Height          =   255
  145.       Left            =   600
  146.       TabIndex        =   1
  147.       Top             =   240
  148.       Width           =   1575
  149.    End
  150. End
  151. Dim hd_ind$, drive$, un$, qk$, sd$, dt$, t%, cmmd$, setfmt$
  152.  
  153.  
  154. Sub CheckHD_Click ()
  155.     If CheckHD.value = 1 Then
  156.         hd_ind$ = "Y"
  157.         option3.visible = 0
  158.         option5.visible = 0
  159.     Else
  160.         hd_ind$ = "N"
  161.         option3.visible = 1
  162.         option5.visible = 1
  163.     End If
  164. End Sub
  165.  
  166. Sub CheckQk_Click ()
  167.     If CheckQk.value = 1 Then
  168.         qk$ = " /q"
  169.     Else
  170.         qk$ = ""
  171.     End If
  172. End Sub
  173.  
  174. Sub CheckSd_Click ()
  175.     If checkSd.value = 1 Then
  176.         sd$ = " /s"
  177.     Else
  178.         sd$ = ""
  179.     End If
  180. End Sub
  181.  
  182. Sub CheckUn_Click ()
  183.     If CheckUn.value = 1 Then
  184.         un$ = " /u"
  185.     Else
  186.         un$ = ""
  187.     End If
  188. End Sub
  189.  
  190. Sub drive1_Change ()
  191.     infobox.text = ""
  192.     drive$ = drive1.drive
  193.     If Len(drive$) > 2 Then
  194.         infobox.text = "This is not a floppy drive! Returning to C:."
  195.         ChDrive "c:"
  196.         drive1.drive = "c:"
  197.         drive$ = drive1.drive
  198.         warn.visible = 0
  199.         GoTo skipit
  200.     End If
  201.     If drive$ <> "a:" Then
  202.         If drive$ <> "b:" Then
  203.             warn.visible = 1
  204.         End If
  205.     Else
  206.         warn.visible = 0
  207.     End If
  208. skipit:
  209. End Sub
  210.  
  211. Sub fmtit_Click ()
  212.     t% = Shell(cmmd$)
  213.     fmtit.visible = 0
  214.     fmtit.enabled = 0
  215.             stopit.visible = 0
  216.             stopit.enabled = 0
  217.             Quickfmt.enabled = 1
  218.             CheckHD.enabled = 1
  219.             CheckQk.enabled = 1
  220.             checkSd.enabled = 1
  221.             CheckUn.enabled = 1
  222.             option5.enabled = 1
  223.             option3.enabled = 1
  224.             drive1.enabled = 1
  225.     cmmd$ = ""
  226.     infobox.text = ""
  227. End Sub
  228.  
  229. Sub Quickfmt_Click ()
  230.         If Len(drive$) < 3 And drive$ <> "" Then
  231.             infobox.text = ""
  232.             cmmd$ = "format.com " + drive$ + qk$ + un$ + sd$
  233.             If hd_ind$ = "N" Then
  234.                 If option3.value Then
  235.                     cmmd$ = cmmd$ + " /f:720"
  236.                 Else
  237.                     cmmd$ = cmmd$ + " /f:360"
  238.                 End If
  239.             End If
  240.             infobox.text = cmmd$
  241.             fmtit.visible = 1
  242.             fmtit.enabled = 1
  243.             stopit.visible = 1
  244.             stopit.enabled = 1
  245.             Quickfmt.enabled = 0
  246.             CheckHD.enabled = 0
  247.             CheckQk.enabled = 0
  248.             checkSd.enabled = 0
  249.             CheckUn.enabled = 0
  250.             option3.enabled = 0
  251.             option5.enabled = 0
  252.             drive1.enabled = 0
  253.         Else
  254.             infobox.text = "Please pick a floppy drive!"
  255.         End If
  256. End Sub
  257.  
  258. Sub stopit_Click ()
  259.     fmtit.visible = 0
  260.     fmtit.enabled = 0
  261.     stopit.visible = 0
  262.     stopit.enabled = 0
  263.             Quickfmt.enabled = 1
  264.             CheckHD.enabled = 1
  265.             CheckQk.enabled = 1
  266.             checkSd.enabled = 1
  267.             CheckUn.enabled = 1
  268.             option5.enabled = 1
  269.             option3.enabled = 1
  270.             drive1.enabled = 1
  271.     cmmd$ = ""
  272.     infobox.text = ""
  273.  
  274. End Sub
  275.  
  276.